// 构造函数模式
function Animal(){//  父类
    this.species = '动物'
}
Animal.prototype.sayHi = function(){
   console.log('----');
}
function Cat(name,color){
   // Animal.apply(this,arguments);
    this.name = name;
    this.color = color;
}
// prototype 模式
Cat.prototype=new Animal();
let cat = new Cat('lwb','黄色');
Cat.prototype.constructor = Cat;
console.log(cat.species,cat.sayHi());